package com.homework.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.homework.entity.HomeworkRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

@Mapper
public interface HomeworkRecordMapper extends BaseMapper<HomeworkRecord> {

    /**
     * 查询指定日期范围内的完成时间趋势数据
     */
    List<Map<String, Object>> getCompletionTimeTrend(@Param("studentId") Long studentId,
                                                     @Param("startDate") LocalDateTime startDate,
                                                     @Param("endDate") LocalDateTime endDate);

    /**
     * 查询指定日期范围内的开始时间趋势数据
     */
    List<Map<String, Object>> getStartTimeTrend(@Param("studentId") Long studentId,
                                               @Param("startDate") LocalDateTime startDate,
                                               @Param("endDate") LocalDateTime endDate);

    /**
     * 查询指定月份的日历数据
     */
    List<Map<String, Object>> getCalendarData(@Param("studentId") Long studentId,
                                              @Param("year") Integer year,
                                              @Param("month") Integer month);

    /**
     * 查询指定学生的作业完成记录
     */
    List<Map<String, Object>> getHomeworkRecords(@Param("studentId") Long studentId,
                                                @Param("year") Integer year,
                                                @Param("month") Integer month);
}